#include "can_bus_dev.h"
#include <QMessageBox>

can_bus_dev::can_bus_dev(QObject *parent) : QObject(parent)
{

}

can_bus_dev::can_bus_dev(const QString &plugin, const QString &interfaceName, QString *errorMessage, QObject *parent) : QObject(parent)
{
    this->canDevice = QCanBus::instance()->createDevice(plugin,interfaceName,errorMessage);
    if(!this->canDevice)
    {
        QMessageBox::information(nullptr,"CAN设备创建失败",*errorMessage);
        this->is_dev_crea = false;
    }
    else
        this->is_dev_crea = true;
}
